package person;
import course.Course;

public class Teacher extends Person {
    private Course course;
 // bindTaughtCourse方法，完成教师与课程的关联
    public void bindTaughtCourse(Course course) {
        this.course = course;
    }
    public String getName() {
        return name;
    }
    public Teacher(int id, String name, String gender, Course course) {
        super(id, name, gender);
        this.course = course;
    }

    public Course getCourse() { return course; }

    public void printInfo() {
        super.printInfo();
        if (course != null) {
            System.out.println("讲授课程：" + course.getName() + "，上课时间：" + course.getTime() + "，地点：" + course.getLocation());
        } else {
            System.out.println("暂未讲授课程");
        }
    }
}